package com.maven.ioc.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


@Controller
@RequestMapping("/prop")
public class PropController {

    //  我们通过 @Value 中注解来 获取 配置文件中的内容
    // 读取格式: ${ }
    @Value("${server.port}")
    private String port;


    @ResponseBody
    @RequestMapping("/r1")
    public String r1() {
        System.out.println(port);
        return port;
    }
}
